import type { AxiosRequestConfig, AxiosResponse } from 'axios'

//定义拦截器类型
export interface IInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestErrorInterceptor?: (error: any) => any
  responseInterceptor?: (res: T) => T
  responseErrorInterceptor?: (error: any) => any
}
//扩展config(请求配置)类型
export interface IConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: IInterceptors<T>
  isShowLoading?: boolean
}
